//问题列表
if(/[0-9]/.test($.cookie("closeQue"))){location.reload()}//详情页结帖返回刷新页面
var isover=0;
var username;//用户中文名
var currentIndex=1;//页码
var ajaxover=0;//控制页面滚动 0不能滚动
$().ready(function(){
    $.cookie("fqscrollTop",0);
    aj();
});
var userAgentInfo = navigator.userAgent;
//alert(userAgentInfo);//Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var IsPC="yes";
for (var v = 0; v < Agents.length; v++) {
    if (userAgentInfo.indexOf(Agents[v]) > 0) {
        IsPC="no";
        break;
    }
}
function gotransf(e){
    location.href="sendexpgpc.html#queChange="+e.dataset.qid+"#clear";//清除缓存关键词
    ////console.log(e.dataset.qid);
    //if(IsPC=="yes"){
    //    //pc端
    //    //location.href="transfpc.html?qid="+e.dataset.qid;
    //    //没有图片上传 只有选择 通用
    //    location.href="transf.html?qid="+e.dataset.qid;
    //}
    //else if(IsPC=="no"){
    //    //移动
    //    location.href="transf.html?qid="+e.dataset.qid;
    //}
}
//问题列表------------------------------------------------------------------
var ajaxrunning="yes";//初始状态不可以滚动
function aj(){
    if(isover===0){
        ajaxrunning="yes";
        $.ajax({
            type:"get",
            datatype: "json",
            url: myquestionurl+"?userId="+id+"&pageSize=15&currentIndex="+currentIndex,
            success:function(data){
                //console.log(data);
                if(data.Message==="没有数据"||!data.Data||data.Data.length==0){
                    isover=1;//没有数据了
                    $("#waiting").css("display","none");
                    $("#nonews").css("display","block");
                }else{
                    if(data.Data&&data.Data.length>0){
                        if(data.Data.length<15){
                            $("#waiting").css("display","none");
                            $("#nonews").css("display","block");
                        }

                        var num=0;
                        for(var i=0;i<data.Data.length;i++){
                            num++;
                            if(num===data.Data.length){
                                ajaxrunning="no";
                            }
                            var tim=data.Data[i].cTime.match(/([0-9\-]+)/)[0];
                            if(data.Data[i].cTime){
                                tim=getDateDiff(getDateTimeStamp(data.Data[i].cTime));
                            };
                            if(!tim){tim="刚刚"}
                            var count=0;
                            if(data.Data[i].browseCount){count=data.Data[i].browseCount;}
                            var nimingimg="";
                            if(data.Data[i].isHideName===1){
                                nimingimg="<img class='rt' src='img/niming.png'>"
                            }
                            var score= parseFloat(data.Data[i].score)/100;
                            var money="<span class='havemy'><img src='img/money04.png'>"+score+"</span>";
                            var tit=codetoface(data.Data[i].title);
                            if(data.Data[i].status===1){
                                if(data.Data[i].answerCount>0){ //如果有回答
                                    $("#questionlist").append("<div class='pagedlist_item'><div class='feed_item feed_type_question'><div class='EventHeader'><span class='senduser'>"+data.Data[i].userNick+"</span><span class='job'></span>·"+tim+nimingimg+money+"</div><h2><a class='question_link' href='questiondetail.html?qid="+data.Data[i].id+"#fromuser="+id+"'>"+tit+"</a></h2><div class='ContentFooter QuestionFooter'>浏览 "+count+"&nbsp;&nbsp;&nbsp;"+"回答 "+data.Data[i].answerCount+"</div><div class='ActionBar Question'><a class='WriteAnswer Button gofinish' data-score='"+data.Data[i].score+"' data-qid='"+data.Data[i].id+"' data-count='"+data.Data[i].answerCount+"' onclick='gofinish(this)'>去结帖</a></div></div></div>")
                                }else if(data.Data[i].answerCount==0){
                                    $("#questionlist").append("<div class='pagedlist_item'><div class='feed_item feed_type_question'><div class='EventHeader'><span class='senduser'>"+data.Data[i].userNick+"</span><span class='job'></span>·"+tim+nimingimg+money+"</div><h2><a class='question_link' href='questiondetail.html?qid="+data.Data[i].id+"#fromuser="+id+"'>"+tit+"</a></h2><div class='ContentFooter QuestionFooter'>浏览 "+count+"&nbsp;&nbsp;&nbsp;"+"回答 "+data.Data[i].answerCount+"</div><div class='ActionBar Question' style='display:none;'><a class='WriteAnswer Button gofinish' data-score='"+data.Data[i].score+"' data-qid='"+data.Data[i].id+"' data-count='"+data.Data[i].answerCount+"' onclick='gofinish(this)' style='background-color:#F9F9F9;color:#999;'>去结帖</a></div></div></div>")
                                }
                            }
                            if(data.Data[i].status===0){
                                $("#questionlist").append("<div class='pagedlist_item'><div class='feed_item feed_type_question'><div class='EventHeader'><span class='senduser'>"+data.Data[i].userNick+"</span><span class='job'></span>·"+tim+nimingimg+money+"</div><h2><a class='question_link' href='questiondetail.html?qid="+data.Data[i].id+"#fromuser="+id+"' id='q"+data.Data[i].id+"'>"+tit+"</a></h2><div class='ContentFooter QuestionFooter'>浏览 "+count+"&nbsp;&nbsp;&nbsp;回答 "+data.Data[i].answerCount+"</div><div class='ActionBar Question'><a class='WriteAnswer Button btndisabled'>已结帖</a></div><div class='ActionBar Question transf'><a class='WriteAnswer Button btndisabled' onclick='gotransf(this)' data-qid='"+data.Data[i].id+"'>转为经验赚钱</a></div></div></div>")
                            }
                        }
                        ajaxover=1;
                    }else{
                        $("#waiting").css("display","none");
                        $("#nonews").css("display","block");
                    }
                }
            }
        })
    }
}
//结贴功能
var havemoney=0;//问题又没有钱 0没有 1有
var questionid="";
var gofinishcurrentIndex=1;
var questioncount=0;//问题详情所需数据
var questionscore=0;
var clicknum=0;//点击次数 选择的人的个数
var canchoiceother=true;
var inputnum=100;
function gofinish(e){
    var scrollTop=$(window).scrollTop();
    $.cookie("fqscrollTop",scrollTop);
    questionid=e.dataset.qid;
    questioncount=e.dataset.count;
    questionscore=e.dataset.score;
    if(questioncount>0){
        $.ajax({
            type:"get",
            datatype:"json",
            url:getanswerurl+(questionid)+"&currentIndex=1&pageSize=15&userId="+id,
            success:function(d){
                $("#newsplace div").remove();
                document.getElementById("choicepeople").style.display="block";
                $(window).scrollTop(0);
                document.getElementById("page_wrapper").style.display="none";
                //如果有分数
                if(questionscore>0){
                    havemoney=1;
                    for(var i=0;i< d.Data.proAnswerList.length;i++){
                        //if(d.Data.proAnswerList[i].userId!=id){
                        var answerword=codetoface(d.Data.proAnswerList[i].content);
                        var userimg;//头像
                        if(d.Data.proAnswerList[i].userAva){
                            if(d.Data.proAnswerList[i].ishideName==1){
                                userimg="<img  src='img/af8.png'/>"
                            }else{
                                userimg="<img  src='"+imgurl+d.Data.proAnswerList[i].userAva+"'/>";
                            }
                        }else{
                            userimg="<img  src='img/af8.png'/>"
                        }
                        var usernick="";
                        if(d.Data.proAnswerList[i].ishideName==1){
                            usernick="匿名";
                        }else{
                            usernick=d.Data.proAnswerList[i].userNick;
                        }
                        $("#newsplace").append("<div class='ts_cells'> <div class='Cell'> <div class='tc_image'>"+userimg+"</div> <div class='tc_inner newsplaceright'> <div class='tc_text title'>"+usernick+"<span id='span"+d.Data.proAnswerList[i].answerId+"'></span></div><div class='tc_text words'>"+answerword+"</div> <div class='choiceimg' data-speaker='"+d.Data.proAnswerList[i].userId+"'> <img src='img/hook-no.png' class='imgno' style='display: block;'/> <img src='img/hook01.png' class='imgyes' data-id='"+d.Data.proAnswerList[i].answerId+"' style='display: none'/> </div> </div> </div> </div><div class='action_menu_container' style='display:none;'> <div class='inner'> <div class='action_menu' style='margin-top: 100px;'> <a class='mweb_action_button cancelmoney'>请输入分配比例</a><a class='mweb_action_button deletekey'><div class='wordinputbox'> <input type='text' maxlength='3' class='inputkey' value='100' min='1' max='100'></div> %</a> <a class='mweb_action_button'><span class='cancel'>取消</span><span class=' sendword' data-id='"+d.Data.proAnswerList[i].answerId+"'>确定</span></a></div> </div> </div>");
                    }
                    var clickbtn=document.getElementsByClassName("choiceimg");//选择按钮
                    var imgno=document.getElementsByClassName("imgno");//红图标
                    var imgyes=document.getElementsByClassName("imgyes");//绿图标
                    var inputbox=document.getElementsByClassName("action_menu_container");//弹出输入框
                    var sendword=document.getElementsByClassName("sendword");//弹出输入框确定按钮
                    var cancel=document.getElementsByClassName("cancel");//弹出输入框取消按钮
                    var inputkey=document.getElementsByClassName("inputkey");//弹出输入框input
                    for(var r=0;r<clickbtn.length;r++){
                        clickbtn[r].index=r;
                        clickbtn[r].onclick=function(){
                            if(clickbtn[this.index].dataset.speaker===id){
                                alert("请勿选择自己");
                            }else{
                                if(imgno[this.index].style.display==="block"&&clicknum<3){
                                    //没满100 可以选择
                                    if(canchoiceother){
                                        clicknum++;
                                        var me=this.index;
                                        imgyes[this.index].style.display="block";
                                        imgno[this.index].style.display="none";
                                        inputbox[this.index].style.display="block";
                                        var last=0;//输入多少钱
                                        sendword[me].onclick=function(e){
                                            //console.log(e.target.dataset.id);
                                            if(!inputkey[me].value){inputkey[me].value=1};
                                            $("#span"+e.target.dataset.id).html("("+inputkey[me].value+"%)");
                                            //console.log("dianji");
                                            imgyes[me].setAttribute( 'data-score' ,inputkey[me].value) ;
                                            //allscore[d.Data[me].answer.id]=parseFloat(inputkey[me].value)/100;
                                            inputbox[me].style.display="none";
                                            var choiceimg=document.getElementsByClassName("imgyes");
                                            var tim=0;
                                            for(var r= 0,len=choiceimg.length;r<len;r++){
                                                tim++;
                                                if(choiceimg[r].dataset.score){
                                                    last+=parseFloat(choiceimg[r].dataset.score);
                                                };
                                                //console.log("tim"+tim);
                                                if(tim==len){
                                                    //console.log("眼睛图片遍历结束");
                                                    var lastinput=document.getElementsByClassName("inputkey");//弹出输入框input
                                                    for(var l= 0,len2=lastinput.length;l<len2;l++){
                                                        //console.log("修改value");
                                                        if(last>=100){
                                                            canchoiceother=false;
                                                            lastinput[l].value="";
                                                        }else{
                                                            canchoiceother=true;
                                                            lastinput[l].value=100-last;
                                                            inputnum=100-last;
                                                        }
                                                    }
                                                }
                                            }
                                        };
                                    }
                                }
                                else if(imgno[this.index].style.display==="none"){
                                    if(imgyes[this.index].dataset.id){
                                        $("#span"+imgyes[this.index].dataset.id).html("");
                                    }
                                    clicknum--;
                                    imgyes[this.index].style.display="none";
                                    imgyes[this.index].dataset.score="";
                                    imgno[this.index].style.display="block";
                                    //console.log("clicknum"+clicknum);
                                    var last=0;//输入多少钱
                                    var choiceimg=document.getElementsByClassName("imgyes");
                                    var tim=0;
                                    for(var r= 0,len=choiceimg.length;r<len;r++){
                                        tim++;
                                        if(choiceimg[r].dataset.score){
                                            last+=parseFloat(choiceimg[r].dataset.score);
                                        };
                                        if(tim==len){
                                            var lastinput=document.getElementsByClassName("inputkey");//弹出输入框input
                                            for(var l= 0,len2=lastinput.length;l<len2;l++){
                                                //console.log("取消操作后value");
                                                if(last>=100){
                                                    canchoiceother=false;
                                                    lastinput[l].value="";
                                                }else{
                                                    canchoiceother=true;
                                                    lastinput[l].value=100-last;
                                                    inputnum=100-last;
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                        }
                    }
                    //弹出输入框取消按钮
                    for(var r2=0;r2<cancel.length;r2++){
                        cancel[r2].index=r2;
                        cancel[r2].onclick=function(){
                            clicknum--;
                            imgyes[this.index].style.display="none";
                            imgno[this.index].style.display="block";
                            inputbox[this.index].style.display="none";
                        };
                        //console.log("clicknum"+clicknum);
                    }
                }else{  /////////////////////////////////////////////////////////////////////没有分数
                    for(var i=0;i< d.Data.proAnswerList.length;i++){
                        //if(d.Data.proAnswerList[i].userId!=id){
                        var answerword=codetoface(d.Data.proAnswerList[i].content);
                        var userimg;//头像
                        if(d.Data.proAnswerList[i].userAva){
                            if(d.Data.proAnswerList[i].ishideName==1){
                                userimg="<img  src='img/af8.png'/>"
                            }else{
                                userimg="<img  src='"+imgurl+d.Data.proAnswerList[i].userAva+"'/>";
                            }
                        }else{
                            userimg="<img  src='img/af8.png'/>"
                        }
                        var usernick="";
                        if(d.Data.proAnswerList[i].ishideName==1){
                            usernick="匿名";
                        }else{
                            usernick=d.Data.proAnswerList[i].userNick;
                        }
                        $("#newsplace").append("<div class='ts_cells'> <div class='Cell'> <div class='tc_image'>"+userimg+"</div> <div class='tc_inner newsplaceright'> <div class='tc_text title'>"+usernick+"<span id='span"+d.Data.proAnswerList[i].answerId+"'></span></div> <div class='tc_text words'>"+answerword+"</div><div class='choiceimg' data-speaker='"+d.Data.proAnswerList[i].userId+"'><img src='img/hook-no.png' class='imgno' style='display: block;'/> <img src='img/hook01.png' class='imgyes' data-id='"+d.Data.proAnswerList[i].answerId+"' style='display: none'/> </div> </div> </div> </div></div> </div>");
                    }
                    $('.action_menu .inputkey').bind('input propertychange', function(e) {
                        //包含其他字符
                        if(!/^[0-9]+$/.test(e.target.value)){
                            e.target.value=e.target.value.replace(/[^0-9]/ig,"");
                        }
                        if(e.target.value){
                            if(parseFloat(e.target.value)>100){
                                e.target.value=100;
                            }else{
                                e.target.value=parseFloat(e.target.value);
                            }
                        }
                    });
                    var clickbtn=document.getElementsByClassName("choiceimg");//选择按钮
                    var imgno=document.getElementsByClassName("imgno");//红图标
                    var imgyes=document.getElementsByClassName("imgyes");//绿图标
                    for(var r=0;r<clickbtn.length;r++){
                        clickbtn[r].index=r;
                        clickbtn[r].onclick=function(){
                            if(clickbtn[this.index].dataset.speaker===id){
                                alert("请勿选择自己");
                            }
                            else{
                                if(imgno[this.index].style.display==="block"&&clicknum<3){
                                    clicknum++;
                                    var me=this.index;
                                    imgyes[this.index].style.display="block";
                                    imgno[this.index].style.display="none";
                                    //console.log("clicknum"+clicknum);
                                }else if(imgno[this.index].style.display==="none"){
                                    if(imgyes[this.index].dataset.id){
                                        $("#span"+imgyes[this.index].dataset.id).html("");
                                    }
                                    clicknum--;
                                    imgyes[this.index].style.display="none";
                                    imgno[this.index].style.display="block";
                                    //console.log("clicknum"+clicknum);
                                }
                            }

                        }
                    }
                }
            }
        })
    }
}
function getallanswer(questionid){
    $.ajax({
        type:"get",
        datatype:"json",
        url:getanswerurl+(questionid)+"&currentIndex="+gofinishcurrentIndex+"&pageSize=15&userId="+id,
        success:function(d){
            //console.log("回答者");
            //console.log(d);
            document.getElementById("choicepeople").style.display="block";
            document.getElementById("page_wrapper").style.display="none";
            //如果有分数
            if(questionscore>0){
                havemoney=1;
                for(var i=0;i< d.Data.proAnswerList.length;i++){
                    //if(d.Data.proAnswerList[i].userId!=id){
                    var answerword=codetoface(d.Data.proAnswerList[i].content);
                    var userimg;//头像
                    if(d.Data.proAnswerList[i].userAva){
                        if(d.Data.proAnswerList[i].ishideName==1){
                            userimg="<img  src='img/af8.png'/>"
                        }else{
                            userimg="<img  src='"+imgurl+d.Data.proAnswerList[i].userAva+"'/>";
                        }
                    }else{
                        userimg="<img  src='img/af8.png'/>"
                    }
                    var usernick="";
                    if(d.Data.proAnswerList[i].ishideName==1){
                        usernick="匿名";
                    }else{
                        usernick=d.Data.proAnswerList[i].userNick;
                    }
                    $("#newsplace").append("<div class='ts_cells'> <div class='Cell'> <div class='tc_image'>"+userimg+"</div> <div class='tc_inner newsplaceright'> <div class='tc_text title'>"+usernick+"<span id='span"+d.Data.proAnswerList[i].answerId+"'></span></div> <div class='tc_text words'>"+answerword+"</div> <div class='choiceimg' data-speaker='"+d.Data.proAnswerList[i].userId+"'> <img src='img/hook-no.png' class='imgno' style='display: block;'/> <img src='img/hook01.png' class='imgyes' data-id='"+d.Data.proAnswerList[i].answerId+"' style='display: none'/> </div> </div> </div> </div><div class='action_menu_container' style='display:none;'> <div class='inner'> <div class='action_menu' style='margin-top: 100px;'> <a class='mweb_action_button deletekey'> <div>请输入分配比例</div> <div class='wordinputbox'> <input type='text' maxlength='3' class='inputkey' value='100' min='1' max='100'></div> %</a> <a class='mweb_action_button'><span class='cancel'>取消</span><span class=' sendword' data-id='"+d.Data.proAnswerList[i].answerId+"'>确定</span></a></div> </div> </div>");
                }
                //输入内容监听
                $('.action_menu .inputkey').bind('input propertychange', function(e) {
                    //包含其他字符
                    if(!/^[0-9]+$/.test(e.target.value)){
                        e.target.value=e.target.value.replace(/[^0-9]/ig,"");
                    }
                    if(e.target.value){
                        if(parseFloat(e.target.value)>100){
                            e.target.value=100;
                        }else if(e.target.value==0){
                            e.target.value=1;
                        }else{
                            e.target.value=parseFloat(e.target.value);
                        }
                    }
                });
                var clickbtn=document.getElementsByClassName("choiceimg");//选择按钮
                var imgno=document.getElementsByClassName("imgno");//红图标
                var imgyes=document.getElementsByClassName("imgyes");//绿图标
                var inputbox=document.getElementsByClassName("action_menu_container");//弹出输入框
                var sendword=document.getElementsByClassName("sendword");//弹出输入框确定按钮
                var cancel=document.getElementsByClassName("cancel");//弹出输入框取消按钮
                var inputkey=document.getElementsByClassName("inputkey");//弹出输入框input
                for(var r=0;r<clickbtn.length;r++){
                    clickbtn[r].index=r;
                    clickbtn[r].onclick=function(e){
                        if(clickbtn[this.index].dataset.speaker===id){
                            alert("请勿选择自己");
                        }else{
                            if(imgno[this.index].style.display==="block"&&clicknum<3){
                                clicknum++;
                                var me=this.index;
                                imgyes[this.index].style.display="block";
                                imgno[this.index].style.display="none";
                                inputbox[this.index].style.display="block";
                                var last=0;//输入多少钱
                                sendword[me].onclick=function(e){
                                    if(!inputkey[me].value){inputkey[me].value=1};
                                    $("#span"+e.target.dataset.id).html("("+inputkey[me].value+"%)");
                                    imgyes[me].setAttribute( 'data-score' ,inputkey[me].value) ;
                                    inputbox[me].style.display="none";
                                    var choiceimg=document.getElementsByClassName("imgyes");
                                    var tim=0;
                                    for(var r= 0,len=choiceimg.length;r<len;r++){
                                        tim++;
                                        if(choiceimg[r].dataset.score&&choiceimg[r].dataset.score>0){
                                            last+=parseFloat(choiceimg[r].dataset.score);
                                        };
                                        if(tim==len){
                                            var lastinput=document.getElementsByClassName("inputkey");//弹出输入框input
                                            for(var l= 0,len2=lastinput.length;l<len2;l++){
                                                lastinput[l].value=100-last;
                                            }
                                        }
                                    }
                                };
                            }
                            else if(imgno[this.index].style.display==="none"){
                                if(imgyes[this.index].dataset.id){
                                    $("#span"+imgyes[this.index].dataset.id).html("");
                                }
                                clicknum--;
                                imgyes[this.index].style.display="none";
                                imgyes[this.index].dataset.score="";
                                imgno[this.index].style.display="block";

                                var last=0;//输入多少钱
                                var choiceimg=document.getElementsByClassName("imgyes");
                                var tim=0;
                                for(var r= 0,len=choiceimg.length;r<len;r++){
                                    tim++;
                                    if(choiceimg[r].dataset.score&&choiceimg[r].dataset.score>0){
                                        last+=parseFloat(choiceimg[r].dataset.score);
                                    };
                                    if(tim==len){
                                        var lastinput=document.getElementsByClassName("inputkey");//弹出输入框input
                                        for(var l= 0,len2=lastinput.length;l<len2;l++){
                                            lastinput[l].value=100-last;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                //弹出输入框取消按钮
                for(var r2=0;r2<cancel.length;r2++){
                    cancel[r2].index=r2;
                    cancel[r2].onclick=function(){
                        clicknum--;
                        imgyes[this.index].style.display="none";
                        imgno[this.index].style.display="block";
                        inputbox[this.index].style.display="none";
                    };
                }
            }
        }
    })
}
//返回键 取消closethispagebtn
$("#closethispagebtn").click(function(){
    clicknum=0;
    ajaxover=1;
    document.getElementById("choicepeople").style.display="none";
    document.getElementById("page_wrapper").style.display="block";
    var t=parseFloat($.cookie("fqscrollTop"));
    window.scrollTo(0,t)
});
$("#gotosetpage").click(function(){
    if(document.referrer){
        history.go(-1);
    }else{
        location.href="setpage.html";
    }
});
//完成 页面返回
var peoplefinishClick=false;
$("#peoplefinish").click(function(){
    if(!peoplefinishClick){
        var answerData = [];
        var allmoney=0;
        var imgyes=document.getElementsByClassName("imgyes");//绿图标
        if(imgyes){
            if(havemoney===1){
                for(var i=0;i<imgyes.length;i++){
                    if(imgyes[i].style.display==="block"){
                        var obj = {};
                        obj.answerId =imgyes[i].dataset.id;
                        obj.scorerate =parseFloat(imgyes[i].dataset.score)/100;
                        answerData.push(obj);
                        allmoney+=parseFloat(imgyes[i].dataset.score);
                    }
                }
                if(allmoney!=100){
                    //金钱提示
                    $("#moneynews").css("display","block");
                    setTimeout(function(){
                        $("#moneynews").css("display","none");
                    },2000);
                    clearTimeout();
                }else{
                    peoplefinishClick=true;
                    $.ajax({
                        type:"post",
                        datatype:"json",
                        url:overquestionurl,
                        data:{ "answerData": answerData, "questionId": questionid },
                        success:function(d){
                            havemoney=0;
                            $.cookie("goChangeQue",questionid);//防止上一步 返回进入详情页
                            var t=parseFloat($.cookie("fqscrollTop"));
                            $("#questionlist").scrollTop(t);
                            location.reload();
                        }
                    })
                }
            }
        }
    }
});

//滚动加载更多
$(window).scroll(function(){
    var mainheight=$(".home_feed").height();
    var windowheight=$(window).height();
    var what=$(".home_feed").offset().top;
    var chajuli=$(".home_feed").offset().top - $(window).scrollTop();
    var cz=windowheight-mainheight+50;
    if(chajuli<cz&&ajaxover===1&&ajaxrunning==="no"){
        ajaxover=0;
        if(document.getElementById("page_wrapper").style.display==="block"){
            currentIndex++;
            aj();
        }else if(document.getElementById("choicepeople").style.display="block"){
            gofinishcurrentIndex++;
            getallanswer(questionid);
        }
    }
});
//结帖不能输入0
$("#choicepeople").delegate(".wordinputbox input","input propertychange",function(e) {
    var thisval=e.target.value;
    e.target.value=(thisval).match(/[0-9]+/);
    if(/^0+/.test(thisval)){
        e.target.value=(thisval).replace(/^0+/,"");
    };
    if(parseInt(thisval)>parseInt(inputnum)){
        e.target.value=parseInt(inputnum);
    }
});